<?php

require_once APPLICATION_PATH.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'Component_Abstract.php';

class FeedReader extends Component_Abstract  {

        private $_numberOfItems;
        private $_descLength;
        private $_xmlFilename;

        public function setNumberOfItems($data) {
            $this->_numberOfItems=$data;
            return $this;
        }

        public function getNumberOfItems() {
            return $this->_numberOfItems;
        }

        public function setDescLength($data) {
            $this->_descLength = $data;
            return $this;
        }

        public function getDescLength() {
            return $this->_descLength;
        }

        public function setXmlFilename($data) {
            $this->_xmlFilename=$data;
            return $this;
        }

        public function getXmlFilename() {
            return $this->_xmlFilename;
        }


        public function initComponent() {
            $this->setDescLength($this->getParameter('desc_length'))
            ->setNumberOfItems($this->getParameter('number_of_items'))
            ->setXmlFilename($this->getParameter('xml_file'));
        }

	public function show() {
            $ret=$this->getTmplContent($this->getConfig()->phtml->mainpage);
            return $ret;
	}

        public function demo() {
            $ret=$this->getTmplContent($this->getConfig()->phtml->demopage);
            return $ret;
        }

        public function getConfigPage() {
            return false;
        }

        public function getOptionsDiv() {
            $ret=$this->getTmplContent($this->getConfig()->phtml->optionspage);
            return $ret;
        }
}
